package com.cloudkinto.vo.company;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.util.Date;

@Data
public class CompanyPageVo {

    private Long id;
    @ApiModelProperty("客户代码")
    private String companyCode;
    @ApiModelProperty("OMS管理员账号")
    private String adminAccount;
    @ApiModelProperty("OMS管理员账号id 编辑时带过来")
    private Long adminAccountId;
    @ApiModelProperty("启用状态 0启用1禁用")
    private int status;
    @ApiModelProperty("可用仓库数量")
    private int warehouseNum;
    @ApiModelProperty("可用仓库")
    private String warehouse;
    @ApiModelProperty("创建时间")
    private Date createTime;
    @ApiModelProperty("客户名称")
    private String name;
    @ApiModelProperty("公司名称")
    private String companyName;


    @ApiModelProperty("联系人")
    private String contact;

    @ApiModelProperty("电话")
    private String tel;
    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("IOSS欧盟税号")
    private String iossEuTaxNo;
    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("备注")
    private String tips;
    @ApiModelProperty("产品审核 0免省 1需要审核")
    private int productFreeTrial;


    private Long tenantId;

    public int getWarehouseNum() {
        if (StringUtils.isBlank(warehouse)) return 0;
        return warehouse.split("、").length;
    }
}
